﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xiaov.SmartWeb.Infrastructure.ExtMethod;
using Xiaov.SmartWeb.Model.ActiveRecord;
using Xiaov.SmartWeb.Infrastructure;
using System.Data.OracleClient;
using System.Data;

namespace Xiaov.SmartWeb.Application.PluginSrc.StatisticalSystem.ReportDesign
{
    public partial class Admin_ReportDesign_View : System.Web.UI.Page
    {
        public string tn= HttpContext.Current.Request.QueryString["tn"].ToRequestString().ToUpper();
        public string xml = HttpContext.Current.Request.QueryString["xml"].ToRequestString();
        public Xiaov.SmartWeb.Model.Statistical.GridConfig xmlConfig { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            string xmlpath = "//PluginSrc//StatisticalSystem//Xml//" + xml;
            xmlConfig = new Model.Statistical.GridConfig(tn, xmlpath);
            
            // 获取数据表
            DataSet ds = Maticsoft.DBUtility.DbHelperOra.Query("select t.* ,t.rowid from "+tn+" t where t.dwbm='0' and t.nf=0 and t.yf=0");
            //获取本表指标
            DataSet zbs = Maticsoft.DBUtility.DbHelperOra.Query("select t.zbmc,t.zbbm from zbbmb t where t.bbbm='" + tn + "' and t.jysx = '启用'");
            foreach (DataRow dr in zbs.Tables[0].Rows)
            {
                DataRow d = ds.Tables[0].NewRow();
                d["zbmc"] = dr[0];
                d["zbbm"] = dr[1];
                ds.Tables[0].Rows.Add(d);
            }
            //将数据表输出到页面
            lt.Text = ds.Tables[0].ToHtml();

        }
    }
}